package demo05.FactoryPattern.pizza;

import demo05.FactoryPattern.FactoryImp.PizzaIngredientFactory;
import demo05.FactoryPattern.pizzaImp.Pizza;

public class CheesePizza extends Pizza{
	//工厂模式
	PizzaIngredientFactory ingredientFactory;
	 
	public CheesePizza(PizzaIngredientFactory ingredientFactory) {
		this.ingredientFactory = ingredientFactory;
	}
 
	public void prepare() {
		System.out.println("准备 " + name);
		dough = ingredientFactory.createDough();
		sauce = ingredientFactory.createSauce();
		cheese = ingredientFactory.createCheese();
	}

}
